#include <iostream>
#include <opencv2/opencv.hpp>

using namespace std;

/*转化为灰度图和边缘检测canny*/

int main()
{
    cv::Mat imgRGB, imgGRAY, imgCNY;
    cv::namedWindow("Gray", cv::WINDOW_AUTOSIZE);
    cv::namedWindow("Canny", cv::WINDOW_AUTOSIZE);

    imgRGB = cv::imread("../../resource/image/lenna.jpg");

    cv::cvtColor(imgRGB, imgGRAY, cv::COLOR_RGB2GRAY);
    cv::imshow("Gray", imgGRAY);

    cv::Canny(imgGRAY, imgCNY, 10, 100, 3, true);
    cv::imshow("Canny", imgCNY);

    cv::waitKey(0);

    return 0;
}
